package com.yykj.user.center.server.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.time.LocalDateTime;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/10/20 22:46
 */
@Data
@Entity
public class Patient {

	@Id
	@Column(length = 50)
	private String id;

	@ApiModelProperty("微信openId")
	@Column(length = 50)
	private String openid;

	@ApiModelProperty("患者姓名")
	@Column(length = 50)
	private String patientName;

	@ApiModelProperty("昵称")
	@Column(length = 50)
	private String nickName;

	@ApiModelProperty("患者性别")
	@Column(length = 10)
	private String gender;

	@Column(length = 20)
	@ApiModelProperty("联系电话")
	private String mobile;

	@ApiModelProperty("头像")
	private String avatar = "";

	@ApiModelProperty("身份证号码")
	private String idCard = "";

	@Column(length = 2000)
	@ApiModelProperty("介绍")
	private String info = "";

	@Column(length = 20)
	@ApiModelProperty("登录帐号")
	private String account;

	@Column(length = 50)
	private String password;

	@ApiModelProperty("创建时间")
	@JsonSerialize(using = LocalDate2LongSerializer.class)
	@CreationTimestamp
	private LocalDateTime addTime;

	@ApiModelProperty("更新时间")
	@JsonSerialize(using = LocalDate2LongSerializer.class)
	@UpdateTimestamp
	private LocalDateTime modifyTime;

	@ApiModelProperty("医院ID")
	private Integer hospitalId;

	@ApiModelProperty("出生日期")
	private String birthday;

	@ApiModelProperty("状态 1：启用 2：禁用")
	private Integer state=1;

    @ApiModelProperty("腾讯IM 账号 ID")
    private String tencentAccountId;

}
